﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
    public class DanhmucObj
    {
        private string _DanhmucID;

        public string DanhmucID
        {
            get { return _DanhmucID; }
            set { _DanhmucID = value; }
        }
        private string _Tendanhmuc;

        public string Tendanhmuc
        {
            get { return _Tendanhmuc; }
            set { _Tendanhmuc = value; }
        }
        private string _Thutu;

        public string Thutu
        {
            get { return _Thutu; }
            set { _Thutu = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }
        private string _Title;

        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        private string _Keyword;

        public string Keyword
        {
            get { return _Keyword; }
            set { _Keyword = value; }
        }
        private string _Description;

        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        public DanhmucObj SetValuesFromDataReader(IDataReader reader)
        {
            DanhmucObj obj = new DanhmucObj();
            obj.DanhmucID = (reader["DanhmucID"] is DBNull) ? String.Empty : reader["DanhmucID"].ToString();
            obj.Tendanhmuc = (reader["Tendanhmuc"] is DBNull) ? String.Empty : reader["Tendanhmuc"].ToString();
            obj.Thutu = (reader["Thutu"] is DBNull) ? "0" : reader["Thutu"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            obj.Title = (reader["Title"] is DBNull) ? String.Empty : reader["Title"].ToString();
            obj.Keyword = (reader["Keyword"] is DBNull) ? String.Empty : reader["Keyword"].ToString();
            obj.Description = (reader["Description"] is DBNull) ? String.Empty : reader["Description"].ToString();
            return obj;
        }
    }
}
